package com.dtx.abstractfactory.tablefactory;

import com.dtx.abstractfactory.factory.Factory;
import com.dtx.abstractfactory.factory.Link;
import com.dtx.abstractfactory.factory.Page;
import com.dtx.abstractfactory.factory.Tray;

/**具体的工厂: TableFactory类
 * TableFactory类是Factory类的子类。createLink方法,createTray方法以及createPage方法的处理是
 * 分别生成TableLink,TableTray,TablePage的实例。
 */
public class TableFactory extends Factory {

    @Override
    public Link createLink(String caption, String url) {
        return new TableLink(caption,url);
    }

    @Override
    public Tray createTray(String caption) {
        return new TableTray(caption);
    }

    @Override
    public Page createPage(String title, String author) {
        return new TablePage(title,author);
    }
}
